export const getFromConfig = (dataConfig: any, componentConfig: any) => {
  let config: any = {
    list: [],
  };
  dataConfig.forEach((val: any) => {
    val.list.forEach((element: any) => {
      if (componentConfig.category === element.category && element.type === componentConfig.type) {
        config.id = element.id;
        config.defaultValue = componentConfig.config;
        for (const key in element.config) {
          const _e = element.config[key];
          config.list.push({
            ..._e,
            key,
          });
        }
      }
    });
  });
  return config;
};
